<%-- 
    Document   : admin_listar_prazos
    Created on : 16/03/2011, 20:36:28
    Author     : Welligton
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="br.ufc.quixada.adrs.model.Prazo" %>
<%@page import="br.ufc.quixada.adrs.util.UtilAdrs" %>
<%@page import="java.util.List" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<link rel="stylesheet" type="text/css" href="../css/style.css"/>
<link rel="stylesheet" type="text/css" href="css/stylePrint.css" media="print"/>
<%@include file="admin_seguranca.jsp"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Sistema ADRS - Módulo Administrador</title>
        <script language="JavaScript" type="text/JavaScript">
            ok=false;
            function CheckAll() {
                if(!ok){
                    for (var i=0;i<document.form1.elements.length;i++) {
                        var x = document.form1.elements[i];
                        if (x.name == 'cb') {
                            x.checked = true;
                            ok=true;
                        }
                    }
                }
                else{
                    for (var i=0;i<document.form1.elements.length;i++) {
                        var x = document.form1.elements[i];
                        if (x.name == 'cb') {
                            x.checked = false;
                            ok=false;
                        }
                    }
                }
            }
        </script>
    </head>
    <body>
        <%@include file="../imagemBB.jsp" %>
        <h1>Sistema ADRS - Módulo Administrador</h1>
        <%@include file="admin_menu_tres.jsp" %>
        <div id="content">
            <h2 class="titulo">Gerenciamento de Prazos - Incluir vários ADRS's a vários prazos (Passo 1)</h2>
            <%@include file="/error.jsp"%>
            <%
                List<Prazo> prazosAbertos = (List<Prazo>) session.getAttribute("listaTodosPrazos");
            %>
            <form name="form1" action="../ServletCentral?comando=CmdListarTodosAdrsForaPrazos" method="POST">
                <div>
                    <%if (prazosAbertos == null || prazosAbertos.size() == 0) {%>
                    <h4 align="center">Nenhum prazo pendente atualmente.</h4>
                    <%} else {%>
                    <br/>
                    <h4>Selecione os prazos que deseja adicionar algum ADRS:</h4>
                    <table class="center">
                        <thead>
                            <tr>
                                <th>Selecionar</th>
                                <th>Prazo</th>
                                <th>Atividade</th>
                            </tr>
                        </thead>
                        <tbody>
                            <%  for (Prazo p : prazosAbertos) {%>
                            <tr>
                                <td class="centerNoPrint">
                                    <input type="checkbox" name="cb" value="<%=p.getId()%>"/>
                                </td>
                                <td>
                                    Prazo referente a <%=UtilAdrs.treatToString(p.getInicio())%>
                                    até <%=UtilAdrs.treatToString(p.getFim())%>
                                </td>
                                <td><%=p.tipoQuestionarioToString()%></td>
                            </tr>
                            <%}%>
                        </tbody>
                    </table>
                    <%}%>
                </div>
                <br/><br/>
                <input type="submit" name="envia" value="Continuar" class="button" />
                <a href="javascript:void(null)" onClick="CheckAll();" class="button2">Selecionar Todos</a>
            </form>
            <br/><hr><br/>
            <div class="no-print">
                <a href="admin_gerenciar_prazo.jsp" title="Voltar" class="button2">Voltar</a>
            </div>
        </div>
        <%@include file="../footer.jsp" %>
    </body>
</html>
